home *** CD-ROM | disk | FTP | other *** search
/ Wonky Flux Batch 2019 02 / Wonky_Flux_Batch_2019-02.zip / Wonky Flux Batch 2019-02 / 093 - Land of Spur.dsk / SPUR.CONTROL.S next >
Text File  |  2019-02-17  |  29KB  |  815 lines

  1.                          ; _  _  _  _  _  _  _  _ 
  2.                          ;[_][_][_][_][_][_][_][_]
  3.                          ;
  4.                          ;     The Land of SPUR
  5.                          ;
  6.                          ;     (C)opyright 1987
  7.                          ;       Greg W. Davis
  8.                          ;            and
  9.                          ;     Peripherals Plus
  10.                          ;
  11.                          ; 03/23/87          21:17
  12.                          ; _______________________
  13.                          ;          v3.0
  14.                          ;      Sysop Control
  15.                          ; _  _  _  _  _  _  _  _
  16.                          ;[_][_][_][_][_][_][_][_]
  17.  
  18.  
  19.           on nocar goto linkterm
  20.  
  21.           public list
  22.           public configure
  23.           
  24. main
  25.           input \"SPUR Sysop Control (?=Menu): "i$
  26.           push main
  27.  
  28.           if i$="A" goto listally
  29.           if i$="P" goto listplyr
  30.           if i$="I" goto listitem
  31.           if i$="M" goto listmons
  32.           if i$="R" goto room.dsp
  33.           if i$="W" goto listwep
  34.           if i$="S" goto listspel
  35.           if i$="F" goto listfood
  36.           if i$="C" goto config
  37.           if i$="G" goto object
  38.           if i$="U" goto printer
  39.           if i$="T" goto sound
  40.           if i$="Y" goto time.set
  41.           if i$="D" goto display
  42.           if i$="Q" goto quit
  43.           if i$<>"?" return
  44.  
  45. menu
  46.           setint(1):print \s$\'
  47. [------------------------------------]
  48. [                  Sysop Control Menu        ]
  49. [------------------------------------]
  50. [                 [C] Configure Game         ]
  51. [                 [G] Set Game Objectives    ]
  52. [                 [D] Screen Display         ]
  53. [                 [U] Printer Status         ]
  54. [                 [T] Toggle Sound           ]
  55. [                 [Y] Set Time Defaults      ]
  56. [                 [Q] Quit                   ]
  57. [                                            ]
  58. [------------------------------------]
  59. [                  LIST COMMANDS             ]
  60. [                                            ]
  61. [            [P]layers         [S]pells      ]
  62. [            [I]tems           [M]onsters    ]
  63. [            [W]eapons         [A]llies      ]
  64. [            [R]ooms           [F]ood/Drink  ]
  65. [                                            ]
  66. [------------------------------------]':setint(""):return
  67.  
  68. config
  69.           print \"Configure New System."
  70.           input @0\"Are you sure ?" i$:if i$<>"Y" return
  71.           
  72. configure
  73.           on nocar goto linkterm
  74.           gosub config2
  75.           dy$=dz$+"spur.logon":link dy$
  76.           
  77. config2
  78.           print \"Enter the name of your game:"
  79.           input @3\"->"g$
  80.           print \"Make sure "dx$" drive is on-line"
  81.           print "and press [Return]";:get i$
  82.           print \\"Creating files to "dx$" drive..."
  83.           f$=dx$+"spur.time":kill f$
  84.           create f$
  85.           f$=dx$+"spur.monsters":kill f$
  86.           create f$
  87.           f$=dx$+"spur.spells":kill f$
  88.           create f$
  89.           f$=dx$+"spur.weapons":kill f$
  90.           create f$
  91.           f$=dx$+"spur.items":kill f$
  92.           create f$
  93.           f$=dx$+"spur.stores":kill f$
  94.           create f$
  95.           f$=dx$+"spur.allies":kill f$
  96.           create f$
  97.           f$=dx$+"spur.log":kill f$
  98.           create f$
  99.           f$=dx$+"spur.users":kill f$
  100.           create f$
  101.           
  102.           f$=dm$+"mail":ready f$
  103.           bk$=dx$+"spur.books"
  104.           open #1,bk$:a=mark(1):close
  105.           if (not a) goto config3
  106.           create bk$:open #1,bk$:gosub bld.mgfl
  107.           ready bk$
  108.           msg(0)=999:update
  109. config3
  110.           f$=dx$+"weapons":open #1,f$:a=mark(1):close
  111.           b=34:c=10:gosub reset:wc=x-1
  112.  
  113.           f$=dx$+"items":open #1,f$:a=mark(1):close
  114.           b=30:c=0:gosub reset:ic=x-1
  115.  
  116.           f$=dx$+"stores":open #1,f$:a=mark(1):close
  117.           b=26:c=0:gosub reset:cg=x-1
  118.  
  119.           f$=dx$+"spells":open #1,f$:a=mark(1):close
  120.           b=40:c=0:gosub reset:sc=x-1
  121.  
  122.           f$=dx$+"allies":open #1,f$:a=mark(1):close
  123.           b=26:c=0:gosub reset:ac=x-1
  124.  
  125.           f$=dx$+"monsters":open #1,f$:a=mark(1):close
  126.           b=32:c=0:gosub reset:mc=x-1
  127.  
  128.           f$=dx$+"spur.winners":open #1,f$:a=mark(1):close
  129.           if (not a) goto config4
  130.           create f$:open #1,f$:print #1,'
  131. []        [] [] [] [] [] [] [] [] [] []
  132. []            Conquerors of SPUR     []
  133. []        [] [] [] [] [] [] [] [] [] []':close
  134.           
  135. config4
  136.           x=0
  137. config.lv
  138.           x=x+1:f$="d.level"+str$(x):open #1,f$:a=mark(1):close
  139.           if (not a) goto config.lv
  140.           lc=x-1
  141.           
  142. config5
  143.           f$=dx$+"spur.data":open #2,f$
  144.           input #2,ga$,f,go,oh,ol,og,lg$
  145.           input #2,f,f,f,f,f,f,f
  146.           input #2,sd,pq,mv,td,bd
  147.           input #2,dh,dl:close:kill f$:create f$:open #2,f$
  148.           np=0:lg$=""
  149.           if ga$<>"" goto config5a
  150.           go=1:oh=0:ol=5000:og=0:sd=1:pq=1:mv=0:td=0:bd=1:dh=0:dl=100
  151. config5a
  152.           gosub object
  153.           print #2,g$,np,go,oh,ol,og,lg$
  154.           print #2,lc,mc,ic,sc,wc,ac,cg
  155.           print #2,sd,pq,mv,td,bd
  156.           print #2,dh,dl:close
  157.  
  158.           print \\"System files created"
  159.           return
  160.  
  161.                          ; **********************************
  162.                          ; *  Set Variable Game Objectives  *
  163.                          ; **********************************
  164.           
  165. object
  166.           print \"[ Game Objective ]"
  167.           print "Current Game Objective is #"go
  168.           if og<>0 print "Item number is "og
  169.           g1=oh:g2=ol:gosub prt.gold:print "Gold amount is "gd$
  170.           print \'
  171. 1.        Get out w/Specific Amt. of Gold
  172. 2.        Get out w/Special Item
  173. 3.        Get out w/Gold & Item
  174.  
  175. Please    Choose by number (CR=Abort): ';:input @2 i$
  176.           if i$="" return
  177.           a=val(i$):if (a<1) or (a>3) goto object
  178.           go=a
  179.           if a=1 goto object2
  180.  
  181. object1
  182.           if ic=0 print \"No ITEMS are currently defined.":go=1:goto object2
  183.           dy$=dx$+"items"
  184. object1a
  185.           input \"Item # or [L]ist: "i$
  186.           if i$="L" gosub listitem:goto object1a
  187.           x=val(i$):if (x<1) or (x>ic) print \"Items 1-"ic:goto object1a
  188.           open #1,dy$:position #1,30,x:input #1,cb$\it$\it:close #1:ty$=left$(it$,1):og$=mid$(it$,3)
  189.           if cb$="*" print \"ITEM has been killed":goto object1a
  190.           if ty$<>"T" print \"The ITEM must be a carried Treasure":goto object1a
  191.           i$="JEWEL":gosub chk.obj
  192.           i$="DIAMOND":gosub chk.obj
  193.           i$="GOLD":gosub chk.obj
  194.           i$="SILVER":gosub chk.obj
  195.           i$="COIN":gosub chk.obj
  196.           print \"Item selected is "og$:og=x
  197.           if a=2 then oh=0:ol=0:goto object
  198.           
  199. object2
  200.           input \"Amount of Gold (in Thousands)? "a$:a=val(a$):if a<0 goto object2
  201.           oh=a/10:ol=a mod 10:ol=ol*1000
  202.           if go=1 then og=0
  203.           goto object
  204.           
  205. chk.obj
  206.           if instr(i$,og$) print \"The item can not be "i$:pop:goto object1a
  207.           return
  208.           
  209. reset
  210.           if a create f$
  211.           open #1,f$
  212.           print #1,c:x=1
  213. count
  214.           position #1,b,x
  215.           input #1,cb$
  216.           if cb$="" close:return
  217.           if cb$="*" goto count2
  218.           cb$="1":if x<=c then cb$="2"
  219.           position #1,b,x
  220.           print #1,cb$
  221. count2
  222.           x=x+1:goto count
  223.           
  224.                          ; *******************
  225.                          ; *  List Routines  *
  226.                          ; *******************
  227.  
  228. listally
  229.           if pq gosub ptr.pmt
  230.           print #o,\"Allies"\
  231.           dy$=dx$+"allies"
  232.           open #1,dy$:x=1
  233. listaly2
  234.           position #1,26,x
  235.           input #1,cb$\x1$\x2,x3
  236.           setint(1)
  237.           if cb$="*" goto listaly3
  238.           print #o,right$("   "+str$(x),3)". Strength:"right$(" "+str$(x2),2)" Hit: "x3"0%                    Name:"x1$
  239. listaly3
  240.           x=x+1:if (x>ac) or (key(1)) close:return
  241.           goto listaly2
  242.  
  243. listmons
  244.           if pq gosub ptr.pmt
  245.           print #o,\"Monsters"\
  246.           dy$=dx$+"monsters"
  247.           open #1,dy$:x=1
  248. listmns2
  249.           position #1,32,x
  250.           input #1,cb$\m$\ms,sw
  251.           setint(1)
  252.           if cb$="*" goto listmns3
  253.           ty$=left$(m$,1):m$=mid$(m$,3)
  254.           print #o,right$("   "+str$(x),3)". ";
  255.           print #o,"Strength: "right$(" "+str$(ms),2);
  256.           print #o,"     Special Wep: "right$("  "+str$(sw),3)"       Name: "m$
  257. listmns3
  258.           x=x+1:if (x>mc) or (key(1)) close:return
  259.           goto listmns2
  260.  
  261. listspel
  262.           if pq gosub ptr.pmt
  263.           print #o,\"Spells"\
  264.           dy$=dx$+"spells"
  265.           open #1,dy$:x=1
  266. listspl2
  267.           position #1,40,x
  268.           input #1,cb$\q$,q2$,q3,q4
  269.           setint(1)
  270.           if (cb$="*") or (cb$="") goto listspl3
  271.           print #o,right$("   "+str$(x),3)". "left$(q$+"                     ",21);right$("    "+str$(q4),4)"g  "str$(q3)"0% "q2$
  272. listspl3
  273.           x=x+1:if (x>sc) or (key(1)) close:return
  274.           goto listspl2
  275.  
  276. listitem
  277.           if pq gosub ptr.pmt
  278.           print #o,\"Items"\
  279.           dy$=dx$+"items"
  280.           open #1,dy$:x=1
  281. listitm2
  282.           position #1,30,x
  283.           input #1,cb$\it$\it
  284.           setint(1)
  285.           if cb$="*" goto listitm3
  286.           ty$=left$(it$,1):it$=left$(mid$(it$,3)+"                    ",20)
  287.           print #o,right$("   "+str$(x),3)". "it$" Type: "ty$"  "right$("   "+str$(it),3)"g"
  288. listitm3
  289.           x=x+1:if (x>ic) or (key(1)) close #1:return
  290.           goto listitm2
  291.  
  292. listwep
  293.           if pq gosub ptr.pmt
  294.           print #o,\"Weapons"\
  295.           dy$=dx$+"weapons"
  296.           open #1,dy$:x=1
  297. listwep2
  298.           position #1,34,x
  299.           input #1,cb$\w$\s,d,v
  300.           setint(1)
  301.           if cb$="*" goto listwep3
  302.           ty$=left$(w$,1):w$=left$(mid$(w$,3)+"                  ",18)
  303.           print #o,right$("   "+str$(x),3)". "w$"Class: "ty$"  "right$("    "+str$(v),4)"g       Stability: "s"0%    Damage: "d"0%" 
  304. listwep3
  305.           x=x+1:if (x>wc) or (key(1)) close:return
  306.           goto listwep2
  307.  
  308. listfood
  309.           if pq gosub ptr.pmt
  310.           print #o,\"Rations"\
  311.           dy$=dx$+"stores"
  312.           open #1,dy$:x=1
  313. listfd2
  314.           position #1,26,x
  315.           input #1,cb$\gs$\gs
  316.           setint(1)
  317.           if cb$="*" goto listfd3
  318.           ty$=left$(gs$,1):gs$=left$(mid$(gs$,3)+"                  ",18)
  319.           print #o,right$("   "+str$(x),3);". ";
  320.           if ty$="F" print #o,"Food   :";:else if ty$="D" print #o,"Drink  :";:else print #o,"Cursed :";
  321.           print #o,gs$   ;right$("   "+str$(gs),3)" gold"
  322. listfd3
  323.           x=x+1:if (x>cg) or (key(1)) close:return
  324.           goto listfd2
  325.  
  326. listplyr
  327.           if pq gosub ptr.pmt
  328.           print #o,\"Players:"\
  329.           dy$=dx$+"spur.users":open #1,dy$:x=1
  330.           dw$="b:users":open #2,dw$
  331. lstplyr2
  332.           position #1,130,x
  333.           input #1,n$,b1,b2\f\g1,g2,g3,g4\s1,s2,s3
  334.           setint(1)
  335.           if not b1 goto lstplyr3
  336.           position #2,128,b1:input #2,p1$,p2$
  337.           setint(1)
  338.           gosub gold.cnv
  339.           p1$=p1$+" "+p2$:print #o,right$("    "+str$(b1),4)" "left$(p1$+"                     ",21);
  340.           print #o," DR="right$("   "+str$(s1),3)" ";
  341.           print #o,"SR="right$("   "+str$(s3),3);
  342.           print #o,right$("    "+str$(b2),4)" "left$(n$+"                ",16);
  343.           print #o," "a$" - gold"
  344. lstplyr3
  345.           x=x+1:if (x>np) or (key(1)) close:return
  346.           goto lstplyr2
  347.           
  348. gold.cnv
  349.           t1=g1+g3
  350.           t2=g2+g4
  351.           if t2>10000 then t2=t2-10000:t1=t1+1
  352.           b$=str$(t1):a$="0000":if t1=0 then a$="    ":b$=" "
  353.           a$=right$("     "+b$,5)+right$(a$+str$(t2),4)
  354.           return
  355.           
  356. room.dsp
  357.           input @2\"Rooms on which level "i$
  358.           if i$="" return
  359.           x=val(i$):if (x<1) or (x>lc) print \lc" levels only":goto room.dsp
  360.           i$=str$(x):dr$=dx$+"room.level"+i$:f1$=dx$+"d.level"+i$
  361.  
  362. listroom
  363.           if pq gosub ptr.pmt
  364.           open #1,f1$:input #1,ln$,nr,ri:close #1:if not nr print \"Level not defined.":return
  365.           dy$=dm$+"mail":ready dy$
  366.           open #1,dr$:a=mark(1):close #1
  367.           if a print \"No rooms to read":return
  368.           input @2\"Start at room # "i$:x=val(i$):if x<1 then x=1
  369.           if x>nr then x=nr
  370.           ready dr$
  371. listrm2
  372.           edit(0)
  373.           input #msg(x),lo$,m,i,wp,fd,n,s,e,w,rc,rt
  374.           if lo$="" goto listrm3
  375.           copy #6,#8
  376.           setint(1)
  377.           print #o,\md$\
  378.           print #o,"Room Number  : "x
  379.           print #o,"Contains     : ";
  380.           if m print #o,"Monster # "m"  ";
  381.           if i print #o,"Item # "i"  ";
  382.           if wp print #o,"Weapon # "wp"  ";
  383.           if fd print #o,"Ration # "fd"  ";
  384.           if (not m) and (not i) and (not wp) and (not fd) print #o,"Nothing";
  385.           print #o
  386.           print #o,"Exits        :";
  387.           if n print #o," North";
  388.           if s print #o," South";
  389.           if w print #o," West";
  390.           if e print #o," East";
  391.           print #o,\\"Room command : ";:if rc=1 print #o,"UP";:else if rc=2 print #o,"DOWN";:else print #o,"NONE";
  392.           if (rc>0) and (rt>0) print #o," - to #"rt:else if (rc>0) and (rt=0) print #o," - Shoppe":else print #o
  393.           print #o,"Room Name    : "lo$
  394.           print #o,\"Room Description :"\
  395.           copy #8,#o
  396.           print #o,\
  397. listrm3
  398.           x=x+1:if (x>nr) or (key(1)) return
  399.           if lo$="" goto listrm2
  400.           if o=0 print \md$:input @2\"Q=Quit, C/R=Continue: "i$:if i$="Q" return
  401.           goto listrm2
  402.  
  403. ptr.pmt
  404.           o=0:if info(0) return
  405.           q$="":input @0\"Send output to printer? "q$
  406.           if q$="Y" then o=5
  407.           return
  408.           
  409. printer
  410.           input \"Printer Prompts - [ON] or [OFF] -> "i$
  411.           if i$="ON" then pq=1
  412.           if i$="OFF" then pq=0
  413.           return
  414.           
  415. sound
  416.           if sd then sd=0:tone(133,50):print \"Sound is OFF":return
  417.           tone(119,75):tone(99,75):tone(94,75):tone(99,75)
  418.           sd=1:print \"Sound is ON":return
  419.           
  420. time.set
  421.           a=mv/60
  422.           print \"Current time limit: ";:if a print a" mins.":else print "Unlimited"
  423. set.tim1
  424.           input @2\"Enter time limit -> "i$
  425.           if i$="" goto set.tim2
  426.           e=val(i$):if (e<0) or (e>90) print \"Enter 0-90":goto set.tim1
  427.           mv=e*60
  428. set.tim2
  429.           print \"Time limit: ";:if not mv print "Unlimited time":else print mv/60" mins"
  430.           return
  431.           
  432. display
  433.           print \"BBS User Stats - Currently ";:if td print "[ON]":else print "[OFF]"
  434.           input \"BBS User Stats - [ON] or [OFF] -> "i$
  435.           if i$="ON" then td=1
  436.           if i$="OFF" then td=0
  437.           text:home:if td print ^
  438.           print \"BBS User Stats - Currently ";:if td print "[ON]":else print "[OFF]"
  439.           print \"SPUR Stats - Currently ";:if bd print "[ON]":else print "[OFF]"
  440.           input \"SPUR Stats - [ON] or [OFF] -> "i$
  441.           if i$="ON" then bd=1
  442.           if i$="OFF" then bd=0
  443.           if bd gosub screen:else poke 35,24:home
  444.           print \"SPUR Stats - Currently ";:if bd print "[ON]":else print "[OFF]"
  445.           return
  446.           
  447. list
  448.           on nocar goto linkterm
  449.           if xl$="listally" gosub listally:goto relink
  450.           if xl$="listmons" gosub listmons:goto relink
  451.           if xl$="listspel" gosub listspel:goto relink
  452.           if xl$="listitem" gosub listitem:goto relink
  453.           if xl$="listwep" gosub listwep:goto relink
  454.           if xl$="listfood" gosub listfood:goto relink
  455.           if xl$="listplyr" gosub listplyr:goto relink
  456.           if xl$="room0" gosub room0:goto relink
  457.           if xl$="levels" gosub levels0:goto relink
  458.           
  459. room0
  460.           xl$="listroom":xn$="ROOMS":zz=flag:z1=edit(5)+3072:fill z1,255,0
  461. rooms
  462.           print \"Rooms on which"
  463.           input @2\"Level #: "i$:if i$="" then flag=zz:return
  464.           x=val(i$):if (x<1) or (x>lc) print \"Levels 1 to "lc" only.":goto rooms
  465.           dr$=dx$+"room.level"+str$(x):f1$=dx$+"d.level"+str$(x):gosub rd.lvl:ready dr$:flag=z1:lx=x
  466. room2
  467.           print \"[ "xn$" ]"
  468.           print \'[R]ebuild Flags  [M]issing Definitions
  469. [D]efined Rooms  [U]naccessible Rooms'
  470.           input \"[L]ist [E]dit [#] [K]ill or [Q]uit: "i$
  471.           if i$="Q" then x=lx:gosub wr.lvl:flag=zz:return
  472.           if i$="L" gosub listroom:i$="L"
  473.           if i$="E" goto ed.room
  474.           if i$="K" goto kil.room
  475.           if i$="R" goto rm.rbld
  476.           if i$="D" goto rm.defn
  477.           if i$="M" goto rm.miss
  478.           if i$="U" goto rm.unac
  479.           x=val(i$):if x>0 goto ed.room1
  480.           goto room2
  481.  
  482. kil.room
  483.           gosub rd.room
  484. print     \"There are "nr" rooms on "mid$(f1$,5)
  485.           input @2\"Kill room # (CR=Abort): "i$:if i$="" goto rooms
  486.           x=val(i$):if (x<1) or (x>nr) goto kil.room
  487.           input @0\"Are you sure? "i$:if i$<>"Y" goto kil.room
  488.           n=0:s=0:e=0:w=0:m=0:i=0:wp=0:fd=0:rc=0:rt=0:lo$=""
  489.           edit(0)
  490.           gosub wr.room
  491.           goto room2
  492.  
  493. ed.room
  494.           input @2\"Room number (CR=Abort): "i$:x=val(i$):if i$="" goto room2
  495. ed.room1
  496.           if (x<1) or (x>nr) print \"Rooms 1 to "nr" only.":goto ed.room
  497.           gosub rd.room
  498.           if x=1 then rc=2:rt=0
  499.  
  500. ed.room2
  501.           print \"Room Number "x" of "nr" rooms in Level "lx
  502.           print \"M:Monster #  : "m
  503.           print "I:Item #     : "i
  504.           print "P:Weapon #   : "wp
  505.           print "R:Ration #   : "fd
  506.           print "C:Room Cmd # : ";:if rc=1 print "UP";:else if rc=2 print "DOWN";::else print "NONE";
  507.           if (rc>0) and (rt>0) print " - to #"rt:else if (rc>0) and (rt=0) print " - Shoppe":else print
  508.           print \"N:North exit : ";:if n print "YES":else print "NO"
  509.           print "S:South exit : ";:if s print "YES":else print "NO"
  510.           print "E:East exit  : ";:if e print "YES":else print "NO"
  511.           print "W:West exit  : ";:if w print "YES":else print "NO"
  512.           print \"T:Room Title : "lo$
  513.           print \"D:Room Description: ";:if not edit(2) print "[ NONE ]":else print "[ WRITTEN ]"
  514. room.pmt
  515.           input @2\"Which: (?=List) : "i$
  516.           if i$="?" goto ed.room2
  517.           if i$="M" gosub ed.r.mon
  518.           if i$="I" gosub ed.r.itm
  519.           if i$="P" gosub ed.r.wep
  520.           if i$="R" gosub ed.r.rat
  521.           if i$="C" gosub ed.r.cmd
  522.           if i$="N" then n=not n:if n then c=(x<=ri)*nr+x-ri:gosub set.rmpt
  523.           if i$="S" then s=not s:if s then a=nr-ri:c=x+ri-((x>a)*nr):gosub set.rmpt
  524.           if i$="E" then e=not e:if e then b=x mod ri:c=x+1-((b=0)*ri):gosub set.rmpt
  525.           if i$="W" then w=not w:if w then b=x mod ri:c=x+((b=1)*ri)-1:gosub set.rmpt
  526.           if i$="D" print \"Edit room scenario, 1000 bytes max."\:gosub ed.room3
  527. ed.name
  528.           if i$="T" input \"You are in: "lo$:if len(lo$)>25 print \"Maximum 25 char length exceeded"\:goto ed.name
  529.           if i$<>"" goto ed.room2
  530.           
  531. room.sav
  532.           input \"[S]ave [R]eturn [A]bort: "i$
  533.           if i$="A" goto room2
  534.           if i$="R" goto ed.room2
  535.           if i$<>"S" goto room.sav
  536.           if (not n) and (not s) and (not e) and (not w) and (not rc) print \"Exit MUST be defined from this room!":goto ed.room2
  537.           if lo$="" then lo$="ROOM # "+str$(x):print \"Room name = "lo$
  538.           gosub wr.room:goto room2
  539.  
  540. ed.room3
  541.           edit(1)
  542.           if edit(2)>1000 print\"Room desc. too long, please shorten."\:goto ed.room3
  543.           if not edit(2) pop:goto ed.room2
  544.           return
  545.           
  546. ed.r.mon
  547.           input \"Monster #: "m
  548.           if (m<0) or (m>mc) print \"Enter 0-"mc:goto ed.r.mon
  549.           if m=0 print \"No monster waiting!"
  550.           return
  551.           
  552. ed.r.itm
  553.           input \"Item #: "i
  554.           if i=0 print \"No item in room!":return
  555.           if (i<6) or (i>ic) print \"Enter 6-"ic:goto ed.r.itm
  556.           return
  557.           
  558. ed.r.wep
  559.           input \"Weapon #: "wp
  560.           if wp=0 print \"No weapon here!":return
  561.           if (wp<11) or (wp>wc) print \"Enter 11-"wc:goto ed.r.wep
  562.           return
  563.           
  564. ed.r.rat
  565.           input \"Ration #: "fd
  566.           if (fd<0) or (fd>cg) print \"Enter 0-"cg:goto ed.r.rat
  567.           if fd=0 print \"No rations in room!"
  568.           return
  569.  
  570. ed.r.cmd
  571.           input \"Room Command #: "rc
  572.           if (rc<0) or (rc>2) print \"Enter 0, 1, or 2!":goto ed.r.cmd
  573.           if x=1 then rc=2:print \"Ladder can not be edited!":return
  574.           if rc=0 print \"No ladder in this room!":rt=0:return
  575.           if rc=1 print \"Ladder UP!"
  576.           if rc=2 print \"Ladder DOWN!"
  577.           
  578. ed.rc2
  579.           if rc<>0 input "Connect to Room: "rt
  580.           if (rt<1) or (rt>900) goto ed.rc2
  581.           if (rc=1) and (lx=1) then rt=x
  582.           return
  583.           
  584. rm.rbld
  585.           print \"Rebuilding all room flags"\
  586.           fill z1,255,0
  587.           for x=1 to nr
  588.           gosub rd.room
  589.           if lo$="" goto rbld1
  590.           flag(x)=1
  591.           if n then c=(x<=ri)*nr+x-ri:gosub set.rmpt
  592.           if s then a=nr-ri:c=x+ri-((x>a)*nr):gosub set.rmpt
  593.           if e then b=x mod ri:c=x+1-((b=0)*ri):gosub set.rmpt
  594.           if w then b=x mod ri:c=x+((b=1)*ri)-1:gosub set.rmpt
  595. rbld1
  596.           print right$("   "+str$(x),3);chr$(8,3);
  597.           next
  598.           print \\"Rebuild complete."
  599.           gosub wr.lvl
  600.           goto room2
  601.           
  602. rm.defn
  603.           print \"  The following rooms have been defined for level "lx":"\
  604.           for x=1 to nr
  605.           if flag(x) print right$("    "+str$(x),4);
  606.           next
  607.           print \:goto room2
  608.           
  609. rm.miss
  610.           print \"The following rooms can be accessed but have not been defined:"\
  611.           for x=1 to nr
  612.           if (flag(nr+x)) and (not flag(x)) print right$("    "+str$(x),4);
  613.           next
  614.           print \:goto room2
  615.           
  616. rm.unac
  617.           print \"  The following rooms have been defined but can never be accessed:"\
  618.           for x=1 to nr
  619.           if (flag(x)) and (not flag(nr+x)) print right$("    "+str$(x),4);
  620.           next
  621.           print \:goto room2
  622.           
  623. set.rmpt
  624.           flag(nr+c)=1:return
  625.           
  626. rd.room
  627.           edit(0)
  628.           input #msg(x),lo$,m,i,wp,fd,n,s,e,w,rc,rt
  629.           copy #6,#8
  630.           return
  631.  
  632. wr.room
  633.           a=msg(x):kill #msg(x)
  634.           print #msg(x),lo$,m,i,wp,fd,n,s,e,w,rc,rt
  635.           copy #8,#6
  636.           msg(x)=a:update
  637.           flag(x)=1
  638.           return
  639.  
  640. levels0
  641.           zz=flag:z1=edit(5)+3072:flag=z1:fill z1,255,0
  642. levels
  643.           print \'[ LEVELS ]
  644.  
  645. [C]reate  [E]dit [A]dd [K]ill [Q]uit: ';:input i$
  646.           if i$="C" goto cr.lvl
  647.           if i$="K" goto kl.lvl
  648.           if i$="A" goto ad.lvl
  649.           if i$="Q" then flag=zz:return
  650.           if i$<>"E" goto levels
  651.  
  652. ed.lvl
  653.           input \"Level #: "i$:x=val(i$)
  654.           f1$=dx$+"d.level"+i$:gosub rd.lvl
  655.           if ln$="" goto ed.lvl3
  656. ed.lvl2
  657.           print \"Level "x" with "nr" rooms"
  658.           print \"[1] Level Name: "ln$
  659.           print "[2] Room Incr.: "ri\
  660.           input @2\"Which (1-2,CR): "i$
  661.           if i$="1" input \"Level Name: "ln$
  662.           if i$="2" gosub ed.lvl4
  663.           if i$<>"" goto ed.lvl2
  664.           input \"[S]ave [A]bort [R]eturn: "i$
  665.           if i$="A" then goto levels
  666.           if i$="R" goto ed.lvl2
  667.           if i$<>"S" then goto ed.lvl2
  668.           nr=ri*ri:gosub wr.lvl
  669.           goto levels
  670. ed.lvl3
  671.           input @0 \"No data file, Create? "i$
  672.           if i$<>"Y" goto levels
  673.           goto cr.lvl
  674.  
  675. ed.lvl4
  676.           input @2\"Room Increment (2-30): "i$:if i$="" return
  677.           i=val(i$)
  678.           if (i<2) or (i>30) print \"Illegal dimension":goto ed.lvl4
  679.           print \"This will create a "i"x"i" level with "(i*i)" rooms."
  680.           print '
  681. You       MUST alter existing rooms and define
  682. new       rooms to accomodate this new grid!'
  683.           input @0\"Is this OK? "i$:if i$<>"Y" return
  684.           ri=i:return
  685.  
  686. kl.lvl
  687.           input @2\"Level # (CR=Abort): "i$:if i$="" goto levels
  688.           ln=val(i$):if (ln<1) or (ln>lc) goto kl.lvl
  689.           f1$=dx$+"d.level"+str$(ln):gosub rd.lvl
  690.           dr$=dx$+"room.level"+str$(ln)
  691.           print \"Remove "ln$\"With "nr" rooms? ";
  692.           input @0 i$:if i$<>"Y" goto levels
  693.           f$=dm$+"mail":ready f$:kill dr$:kill f1$:print \"Level Killed"
  694.           if ln<>lc goto kl.lvl2
  695.           lc=lc-1
  696.           print \"You MUST now remove access from this Level in Level"lc
  697.           goto rooms
  698. kl.lvl2
  699.           for i=(ln+1) to lc
  700.           f1$=dx$+"room.level"+str$(i):f2$=dx$+"d.level"+str$(i)
  701.           f3$=dx$+"room.level"+str$(i-1):f4$=dx$+"d.level"+str$(i-1)
  702.           dy$="b:xdos"
  703.           use dy$,"R "+f1$+","+f3$
  704.           use dy$,"R "+f2$+","+f4$:next
  705.           print \"Levels Adjusted.":lc=lc-1
  706.           goto levels
  707.  
  708. ad.lvl
  709.           input @0\"Add a predefined level? "i$
  710.           if i$<>"Y" goto levels
  711.           input \"File name of new Level? "f0$:f0$=dx$+f0$
  712.           open #1,f0$:if mark(1) print \"File not on "dx$" drive.":close:goto ad.lvl
  713.           close:input \"ROOM file name of new level? "f2$:f2$=dx$+f2$
  714.           open #1,f2$:if mark(1) print \"File not on "dx$" drive.":close:goto ad.lvl
  715.           close:f$=dx$+"room.level"+str$(lc+1):f1$=dx$+"d.level"+str$(lc+1)
  716.           print \"Adding new Level #"lc+1
  717.           dy$="b:xdos"
  718.           use dy$,"R "+f0$+","+f1$
  719.           use dy$,"R "+f2$+","+f$
  720.           print \"Checking Monsters, Items, Weapons  and  Rations....."
  721.           for x=1 to nr:z=0:gosub rd.room
  722.           if m>mc then zz$=rnd$:m=random(mc):z=1
  723.           if i>ic then zz$=rnd$:i=random(ic):z=1
  724.           if w>wc then zz$=rnd$:w=random(wc):z=1
  725.           if fd>cg then zz$=rnd$:fd=random(cg):z=1
  726.           if z gosub wr.room
  727.           next:print \"Level Added!":lc=lc+1:goto levels
  728.  
  729. cr.lvl
  730.           print \"Level Number: "lc+1:ln=lc+1
  731.           f1$=dx$+"d.level"+str$(ln):gosub rd.lvl
  732.           if ln$<>"" print \"Level exists!":goto levels
  733.           input \"Level Name: "ln$
  734. cr.lvl2
  735.           input \"Room Increment (2-30): "i$:ri=val(i$)
  736.           if (ri<2) or (ri>30) print \"Illegal dimension":goto cr.lvl2
  737.           print \"This will create a "ri"x"ri" level with "(ri*ri)" rooms."
  738.           input @0\"Is this OK? "i$:if i$<>"Y" goto levels
  739.           nr=ri*ri
  740.           dr$=dx$+"room.level"+str$(ln):create dr$
  741.           open #1,dr$:gosub bld.mgfl
  742.           ready dr$:msg(0)=nr:update
  743.           f1$=dx$+"d.level"+str$(ln):create f1$:fill z1,255,0
  744.           gosub wr.lvl:lc=lc+1:goto levels
  745.  
  746. rd.lvl
  747.           open #1,f1$
  748.           input #1,ln$,nr,ri
  749.           read #1,z1,255
  750.           close #1:return
  751.  
  752. wr.lvl
  753.           open #1,f1$
  754.           print #1,ln$,nr,ri
  755.           write #1,z1,255
  756.           close #1:return
  757.           
  758. bld.mgfl
  759.           ed=edit(5):fill ed,255,0:poke ed,8:poke ed+1,32
  760.           write #1,ed,2:fill ed,255,0:for x=1 to 20:write #1,ed,255:next
  761.           write #1,ed,26:close:return
  762.           
  763. screen
  764.           poke 35,20
  765.           a$=a1$+" "+a2$
  766.           l=len(a$)+12:a=peek(33)-l:a=a/2:l=peek(33)-l:l=l-a
  767.           print #3 @1,22 chr$(45,a)"[ #"right$("   "+str$(un),4)"-"a$" ]-"chr$(45,l):print #3 @1,1
  768.           print #3 @1,23 "LV:      RM:    |PS:     PC:     PW:   "
  769.           print #3 @1,24 "MV:      EP:    |PE:     PD:     PI:   ";
  770.           if peek(33)=40 goto scn.dsp
  771.           print #3 @41,23 "|RT:   IT:   WP:   AR:    SH:    KL:"
  772.           print #3 @41,24 "|XL:   TI:   GH:          DR:    SR:";
  773. scn.dsp
  774.           print #3 @4,23 right$("   "+str$(cl),4)
  775.           print #3 @13,23 right$("    "+str$(cr),4)
  776.           print #3 @21,23 right$("  "+str$(ps),3)
  777.           print #3 @29,23 right$("   "+str$(pt),3)
  778.           print #3 @37,23 right$("   "+str$(pw),3)
  779.           print #3 @4,24 right$("   "+str$(mm),4);
  780.           print #3 @13,24 right$("    "+str$(ep),4);
  781.           print #3 @21,24 right$("  "+str$(pe),3);
  782.           print #3 @29,24 right$("   "+str$(pd),3);
  783.           print #3 @37,24 right$("   "+str$(pi),3);
  784.           print #3 @1,20
  785.           if peek(33)=40 goto scn.rtn
  786.           print #3 @45,23 right$(" "+str$(xf),2)
  787.           print #3 @51,23 right$(" "+str$(xi),2)
  788.           print #3 @57,23 right$(" "+str$(xw),2)
  789.           print #3 @63,23 right$("  "+str$(ar),3)
  790.           print #3 @70,23 right$("  "+str$(sh),3)
  791.           print #3 @77,23 right$("  "+str$(mk),3)
  792.           print #3 @45,24 right$(" "+str$(xp),2);
  793.           print #3 @51,24 right$(" "+str$((ev-ex)/60),2);
  794.           g1=gh:g2=gl:gosub prt.gold:print #3 @57,24 gd$;
  795.           print #3 @70,24 right$("  "+str$(df),3);
  796.           print #3 @77,24 right$("  "+str$(sr),3);
  797. scn.rtn
  798.           print #3 @1,20
  799.           return
  800.           
  801. prt.gold
  802.           a$=str$(g1):gd$="0000":if g1=0 then gd$="    ":a$=" "
  803.           gd$=right$("    "+a$,5)+right$(gd$+str$(g2),4)
  804.           return
  805.           
  806. relink
  807.           dw$=ds$+"spur.sysop":link dw$,"relink"
  808.           
  809. quit
  810.           pop:dy$=ds$+"spur.sysop"
  811.           link dy$
  812.           
  813. linkterm
  814.           dy$=dz$+"spur.logon":link dy$,"quit3"
  815.